package com.ruoyi.project.rm.mapper;

import com.ruoyi.project.rm.pojo.Task;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TaskMapper {

    List<Task> selTaskInfo(String taskName,int n);

    @Update("update task set task_status=0 where task_id=#{param1}")
    int upEndTask(int taskId);

    @Insert("insert into end_task value(default,now(),#{param1})")
    int insAddEndTask(int taskId);

    @Update("update task set task_status=3 where task_id=#{param1}")
    int upPassTask(int taskId);

    @Insert("insert into task value(default,#{taskName},#{taskDesc},1,#{taskIsUrgent},#{startTime},#{endTime},#{releaseId},#{implementId},1,1)")
    int addTask(Task task);


    List<Task> selShowTask(String taskName, int n);
}
